<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/1/28
 * Time: 18:24
 */
namespace common\sources\read\sendddcode;

use common\models\craftsman\SendDdCode;

class SendDdCodeAccess implements ISendDdCodeAccess
{
    public function getSendCode($data)
    {
        return SendDdCode::find()
                        ->select("id,code,create_time")
                        ->where(['phone' => $data['phone']])
                        ->orderBy("create_time desc")
                        ->asArray()
                        ->one();
    }

    public function getSendFundTypeCode($data)
    {
        return SendDdCode::find()
            ->select("id,code,create_time")
            ->where(['operator' => $data['operator']])
            ->orderBy("create_time desc")
            ->asArray()
            ->one();
    }
}